home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Open Prolog 1.0.3d33 / Samples / rooms < prev    next >
Text File  |  1993-10-06  |  246b  |  21 lines

  1. door(a,b).
  2. door(b,e).
  3. door(b,c).
  4. door(d,e).
  5. door(c,d).
  6. door(e,f).
  7. door(g,e).
  8.  
  9. has_phone(g).
  10.  
  11. go(X,X,_,[]).
  12. go(X,Y,T,[Z|R]):-
  13.     Y\==X,
  14.     (door(X,Z) ; door(Z,X)),
  15.     not member(Z,T),
  16.     go(Z,Y,[Z|T],R).
  17.  
  18. member(X,[X|_]).
  19. member(X,[_|R]) :- member(X,R).
  20.  
  21.